home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Rectangle;
- import java.awt.event.MouseAdapter;
- import java.awt.event.MouseEvent;
- import javax.swing.SwingUtilities;
- import javax.swing.tree.TreePath;
-
- public class BasicTreeUI$MouseHandler extends MouseAdapter {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
-
- public BasicTreeUI$MouseHandler(BasicTreeUI var1) {
- this.this$0 = var1;
- }
-
- public void mousePressed(MouseEvent var1) {
- if (this.this$0.tree != null && this.this$0.tree.isEnabled()) {
- this.this$0.tree.requestFocus();
- TreePath var2 = this.this$0.getClosestPathForLocation(this.this$0.tree, var1.getX(), var1.getY());
- if (var2 != null) {
- Rectangle var3 = this.this$0.getPathBounds(this.this$0.tree, var2);
- if (var1.getY() > var3.y + var3.height) {
- return;
- }
-
- if (SwingUtilities.isLeftMouseButton(var1)) {
- this.this$0.checkForClickInExpandControl(var2, var1.getX(), var1.getY());
- }
-
- int var4 = var1.getX();
- if (var4 > var3.x && var4 <= var3.x + var3.width && !this.this$0.startEditing(var2, var1)) {
- this.this$0.selectPathForEvent(var2, var1);
- }
- }
- }
-
- }
- }
-